package com.xbenben.demoroot.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * @author xbenbenx
 * Date:2022/10/12 16:29
 **/
@Service
@Slf4j
public class RegSyncService {

    @Async
    public void sendMsg(){
        // todo :模拟耗时5秒
        try {
            Thread.sleep(5000);
            log.info("---------------发送消息--------");
        }catch (Exception ex){
            ex.printStackTrace();
        }
    }
    @Async
    public void addScore(){
        // todo :模拟耗时5秒
        try {
            Thread.sleep(5000);
            log.info("---------------处理积分--------");
        }catch (Exception ex){
            ex.printStackTrace();
        }
    }


    public void  thorwErro(){

        System.out.println(1/0);

    }


}
